package cn.fyg.service.finance.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import cn.fyg.common.base.retv.Retv;
import cn.fyg.service.finance.domain.login.AccountDto;
import cn.fyg.service.finance.domain.login.LoginService;



@RestController
@RequestMapping("login")
public class LoginController {
	@Autowired
	private LoginService loginservice;
	
	@GetMapping(value = "Hello")
	public String test() {
		return "Hello world";
	}
	
	
	@PostMapping(value = "")
	public Retv<List<AccountDto>> login(@RequestParam("user") String user, @RequestParam("password") String password) {
		return this.loginservice.login(user, password);
	}
	/*
	@PostMapping(value = "/22")
	public String login2(@RequestBody LoginDto loginDto) {
		return this.loginservice.login2(loginDto.getUser(), loginDto.getPassword());
	}
	*/
}
